</interface> \
</node>';
-const BoltClientProxy = Gio.DBusProxy.makeProxyWrapper(BoltClientInterface);
const BoltDeviceProxy = Gio.DBusProxy.makeProxyWrapper(BoltDeviceInterface);
/* */
ENABLED: 'enabled'
};
+const BOLT_DBUS_CLIENT_IFACE = 'org.freedesktop.bolt1.Manager';
const BOLT_DBUS_NAME = 'org.freedesktop.bolt';
const BOLT_DBUS_PATH = '/org/freedesktop/bolt';
_init() {
this._proxy = null;
- new BoltClientProxy(
- Gio.DBus.system,
- BOLT_DBUS_NAME,
- BOLT_DBUS_PATH,
- this._onProxyReady.bind(this)
- );
+ let nodeInfo = Gio.DBusNodeInfo.new_for_xml(BoltClientInterface);
+ Gio.DBusProxy.new(Gio.DBus.system,
+ Gio.DBusProxyFlags.DO_NOT_AUTO_START,
+ nodeInfo.lookup_interface(BOLT_DBUS_CLIENT_IFACE),
+ BOLT_DBUS_NAME,
+ BOLT_DBUS_PATH,
+ BOLT_DBUS_CLIENT_IFACE,
+ null,
+ this._onProxyReady.bind(this));
this.probing = false;
},
- _onProxyReady(proxy, error) {
- if (error !== null) {
- log('error creating bolt proxy: %s'.format(error.message));
- return;
- }
- this._proxy = proxy;
+ _onProxyReady(o, res) {
+ try {
+ this._proxy = Gio.DBusProxy.new_finish(res);
+ } catch(e) {
+ log('error creating bolt proxy: %s'.format(e.message));
+ return;
+ }
this._propsChangedId = this._proxy.connect('g-properties-changed', this._onPropertiesChanged.bind(this));
this._deviceAddedId = this._proxy.connectSignal('DeviceAdded', this._onDeviceAdded.bind(this));